import request from '@/utils/request'
// 获取企业列表
export function getEnterpriseListAPI (params) {
  return request({
    url: '/park/enterprise',
    params
  })
}

// 获取下拉数据
export function getIndustryAPI (params) {
  return request({
    url: '/park/industry',
    params
  })
}

// 增加企业接口
export function addEnterpriseAPI (data) {
  request({
    url: '/park/enterprise',
    method: 'post',
    data
  })
}

// 编辑企业接口
export function getEnterpriseDetailAPI (id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}

// 修改企业
export function updateExterpriseAPI (data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}

// 删除企业
export function deleteEnterpriseAPI (id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'delete'
  })
}

// 展示可租赁的楼宇
export function getRentBuildingAPI () {
  return request({
    url: '/park/rent/building'
  })
}

// 添加租赁合同
export function addRentAPI (data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'post',
    data
  })
}

// 租赁列表展开查看
export function getEnterpriseRentBuildingAPI (id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

// 删除合同的接口
export function deleteRentAPI (id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'delete'
  })
}

// 退租接口
export function rentingOutAPI (id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'put'
  })
}
